package se.hiq.korjournal;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class KorjournalActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.startpage);
        
        OnClickListener onClickListener = new OnClickListener() {
			
			public void onClick(View v) {
				onViewClick(v);
				
			}
		};
        
		Button btn = (Button) findViewById ( R.id.button_starta_resan );		
        btn.setOnClickListener(onClickListener);
        btn = (Button) findViewById ( R.id.button_inst );
        btn.setOnClickListener(onClickListener);
        btn = (Button) findViewById ( R.id.button_avanc_inst );
        btn.setOnClickListener(onClickListener);
        btn = (Button) findViewById ( R.id.button_historik );
        btn.setOnClickListener(onClickListener);
        
    }
    
    public void onViewClick(View v) {
    	
    	int id = v.getId();
    	
    	Intent intent;
    	
    	if ( id == R.id.button_starta_resan ) {
    		starta_resa();
    	}
    	else if (id == R.id.button_inst) {
    		intent = new Intent(this, KorjournalAdvanced.class);
    		this.startActivity(intent);
    	}
    	else if (id == R.id.button_avanc_inst) {
    		intent = new Intent(this, KorjournalAdvanced.class);
	    	this.startActivity(intent);        	
    	}
    	else if (id == R.id.button_historik) {
    		intent = new Intent(this, KorjournalHistory.class);
	    	this.startActivity(intent); 
    	}
        
    }
    
    protected void starta_resa () {
    	//Starta
    }
    
}